//权限配置接口

import request from '@/utils/request'

/**
 * 获取所有权限列表
 * @returns 
 */
export function getPermissionList() {
    return request({
        url: '/sys/permission'
    })
}

//根据id获取权限详情
export function getPermissionDetails(id) {
    return request({
        url: `/sys/permission/${id}`,
    })
}

//添加权限
export function addPermission(data) {
    return request({
        url: '/sys/permission',
        method: 'post',
        data
    })
}

//根据id修改权限
export function updatePermission(data) {
    return request({
        url: `/sys/permission/${data.id}`,
        method: 'put',
        data
    })
}
//根据id删除权限
export function delPermission(id) {
    return request({
        url: `/sys/permission/${id}`,
        method: 'delete'
    })
}